import { constantRoutes } from '@/router/index'

export default {
  namespaced: true,
  state: {
    menuList: [...constantRoutes]
  },
  mutations: {
    setMenuList(state, payload) {
      //  state.menuList = [...payload, ...constantRoutes]
      state.menuList = [...constantRoutes, ...payload]
      //   添加404页面放在路由的最后一页
      state.menuList.push({ path: '*', redirect: '/404', hidden: true })
    }
  }
}
